<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增发票</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
</head>
<body>
<form class="layui-form" action="">

        <div class="layui-form-item">
            <div class="layui-inline">
                    <label class="layui-form-label" style="width: 80px;">发票金额</label>
                <div class="layui-input-inline" style="width: 80px;">
                    <input type="text" name="money" placeholder="￥" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>



    <div class="layui-inline" >
        <label class="layui-form-label">发票类型</label>
        <div class="layui-input-block" style="width: 80px;">
            <select name="type" lay-verify="required" >
                <option value="">选择</option>
                <option value="0">其他普通发票</option>
                <option value="1">增值税专用发票</option>
            </select>
        </div>
    </div>

    <div class="layui-inline">
        <label class="layui-form-label">收件手机</label>
        <div class="layui-input-block" style="width: 110px;">
            <input type="text" name="phone" lay-verify="required"  autocomplete="off" placeholder="请输入手机号码" class="layui-input">
        </div>
    </div>

    <div class="layui-inline" >
        <label class="layui-form-label">合同编号</label>
        <div class="layui-input-block" style="width: 80px;">
            <select name="city" lay-verify="required" >
                <?php foreach($number as $key => $value):?>
                <option value="<?=$value?>"><?= $value?></option>
                <?php endforeach?>
            </select>
        </div>
    </div>
    </div>

    <div class="layui-form-item">
    <div class="layui-inline" >
        <label class="layui-form-label">抬头类型</label>
        <div class="layui-input-block" style="width: 100px;">
            <select name="title" lay-verify="required" >
                <option value="">选择</option>
                <option value="0">企业</option>
                <option value="1">个人</option>
                <option value="2">事业单位</option>
            </select>
        </div>


    <div class="layui-inline">
        <label class="layui-form-label">开票主体</label>
        <div class="layui-input-block" style="width: 110px;">
            <input type="text" name="subject" lay-verify="required"  autocomplete="off" placeholder="开票主体" class="layui-input">
        </div>
    </div>
        <div class="layui-inline">
            <label class="layui-form-label">统一社会信用代码</label>
            <div class="layui-input-inline">
                <input type="text" name="code" lay-verify="required"   autocomplete="off" placeholder="统一社会信用代码" class="layui-input">
            </div>
        </div>
    </div>


    <div class="layui-form-item">



    <div class="layui-inline">
            <label class="layui-form-label">邮寄地址</label>
            <div class="layui-input-inline">
                <input type="text" name="address"  lay-verify="required" autocomplete="off" placeholder="邮寄地址" class="layui-input">
            </div>
    </div>

    <div class="layui-inline">
        <label class="layui-form-label">收件人</label>
        <div class="layui-input-block" style="width: 80px;">
            <input type="text" name="person" lay-verify="required"  autocomplete="off" placeholder="收件人" class="layui-input">
        </div>
    </div>
</div>

    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline" style="width: 100px;">
            <select name="number" lay-verify="required">
                <option value="">选择</option>
                <option value="0">待审核</option>
                <option value="1">审核中</option>
                <option value="2">审核通过</option>
                <option value="3">审核未通过</option>
            </select>
        </div>



        <label class="layui-form-label">客户名称</label>
        <div class="layui-input-inline" style="width: 100px;">
            <select name="name" lay-verify="required" >
                <?php foreach($name as $key => $value):?>
                <option value="{$value}">{$value}</option>
                <?php endforeach?>
            </select>
        </div>

    </div>

    <div class="layui-inline">
        <label class="layui-form-label">发票抬头</label>
        <div class="layui-input-block" style="width: 110px;">
            <input type="text" name="title" lay-verify="required"  autocomplete="off" placeholder="发票抬头" class="layui-input">
        </div>
    </div>

    <div class="layui-inline">
        <label class="layui-form-label">接收邮箱</label>
        <div class="layui-input-block" style="width: 110px;">
            <input type="text" name="email" lay-verify="required"  autocomplete="off" placeholder="接收邮箱" class="layui-input">
        </div>
    </div>

    <div class="layui-inline">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block" style="width: 110px;">
            <input type="text" name="remark" autocomplete="off" placeholder="备注" class="layui-input">
        </div>
    </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal layui-btn-radius" lay-submit lay-filter="*">立即提交</button>
                <button type="reset" class="layui-btn  layui-btn-danger layui-btn-radius layui-btn-primary">重置</button>
            </div>
        </div>
    </div>
</form>
<script src="/static/crm/lib/layui-v2.6.3/layui.js"></script>
<script>
    layui.use(['form','jquery'],function(){
            var form = layui.form,
                $ = layui.jquery,
                layer = layui.layer;
        form.on('submit(*)',function(data){
            // console.log(data.field)
            $.ajax({
                type:'post',
                url:'adds',
                data:data.field,
                dataType:'json',
                success:function(result){
                    layer.msg(result)
                    //重新刷新父页面
                    parent.location.reload();
                }
                ,error: function () {
                    layer.msg('操作失败！！！');
                }
            })
            return false;
        })
    })
</script>
</body>
</html>